<?php

namespace backend\models;

use Yii;

/**
 * This is the model class for table "{{%super_lottery}}".
 *
 * @property integer $issue
 * @property integer $red_1
 * @property integer $red_2
 * @property integer $red_3
 * @property integer $red_4
 * @property integer $red_5
 * @property integer $blue_1
 * @property integer $blue_2
 * @property integer $first_num
 * @property string $first_money
 * @property integer $first_append_num
 * @property string $first_append_money
 * @property integer $second_num
 * @property string $second_money
 * @property integer $second_append_num
 * @property string $second_append_money
 * @property string $sale_total
 * @property string $bonus_total
 * @property string $date
 */
class SuperLottery extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%super_lottery}}';
    }

    /**
     * @return \yii\db\Connection the database connection used by this AR class.
     */
    public static function getDb()
    {
        return Yii::$app->get('db_finance');
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['issue', 'red_1', 'red_2', 'red_3', 'red_4', 'red_5', 'blue_1', 'blue_2', 'date'], 'required'],
            [['issue', 'red_1', 'red_2', 'red_3', 'red_4', 'red_5', 'blue_1', 'blue_2', 'first_num', 'first_append_num', 'second_num', 'second_append_num'], 'integer'],
            [['date'], 'safe'],
            [['first_money', 'first_append_money', 'second_money', 'second_append_money', 'sale_total', 'bonus_total'], 'string', 'max' => 20],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'issue' => Yii::t('app', '期号'),
            'red_1' => Yii::t('app', '红球1'),
            'red_2' => Yii::t('app', '红球2'),
            'red_3' => Yii::t('app', '红球3'),
            'red_4' => Yii::t('app', '红球4'),
            'red_5' => Yii::t('app', '红球5'),
            'blue_1' => Yii::t('app', '蓝球1'),
            'blue_2' => Yii::t('app', '蓝球2'),
            'first_num' => Yii::t('app', '一等奖注数'),
            'first_money' => Yii::t('app', '一等奖资金'),
            'first_append_num' => Yii::t('app', '一等奖追加注数'),
            'first_append_money' => Yii::t('app', '一等奖追加资金'),
            'second_num' => Yii::t('app', '二等奖注数'),
            'second_money' => Yii::t('app', '二等奖资金'),
            'second_append_num' => Yii::t('app', '二等奖追加注数'),
            'second_append_money' => Yii::t('app', '二等奖追加资金'),
            'sale_total' => Yii::t('app', '销售额'),
            'bonus_total' => Yii::t('app', '奖池'),
            'date' => Yii::t('app', '开奖日期'),
        ];
    }
}
